Skip to content

feat(snap-account-service): add handleKeyringSnapMessage#8758

Merged
ccharly merged 11 commits into
mainfrom
cc/feat/snap-account-service-snap-keyring-messages
May 11, 2026
Merged

feat(snap-account-service): add handleKeyringSnapMessage#8758
ccharly merged 11 commits into
mainfrom
cc/feat/snap-account-service-snap-keyring-messages

Conversation

@ccharly
Copy link
Copy Markdown
Contributor

@ccharly ccharly commented May 11, 2026

Explanation

Add handleKeyringSnapMessage, so consumers can re-route those messages automatically through the service.

For now we use the legacy Snap keyring, but once Snap keyring v2 are migrated, we would re-route those message to the proper v2 keyring.

References

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Adds a new messenger-exposed entry point that forwards arbitrary Snap messages into the legacy Snap keyring; misrouting or unexpected message shapes could affect Snap account/keyring operations.

Overview
Adds SnapAccountService.handleKeyringSnapMessage and exposes it as a new messenger action (SnapAccountService:handleKeyringSnapMessage) so consumers can route keyring Snap messages through the service instead of directly using the legacy Snap keyring.

Updates generated action type unions and adds targeted tests verifying forwarding behavior, error propagation, and messenger wiring; also documents the new API in the package changelog.

Reviewed by Cursor Bugbot for commit 92068a5. Bugbot is set up for automated code reviews on this repo. Configure here.

@ccharly ccharly requested a review from a team as a code owner May 11, 2026 10:48
@ccharly ccharly requested a review from a team as a code owner May 11, 2026 11:49
@ccharly ccharly changed the title feat(snap-account-service): add handleKeyringSnapMessage feat(snap-account-service): add handleKeyringSnapMessage May 11, 2026
@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented May 11, 2026

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.3.0-preview-1b5f6ba15
@metamask-previews/accounts-controller@38.0.0-preview-1b5f6ba15
@metamask-previews/address-book-controller@7.1.1-preview-1b5f6ba15
@metamask-previews/ai-controllers@0.6.3-preview-1b5f6ba15
@metamask-previews/analytics-controller@1.0.1-preview-1b5f6ba15
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-1b5f6ba15
@metamask-previews/announcement-controller@8.1.0-preview-1b5f6ba15
@metamask-previews/app-metadata-controller@2.0.1-preview-1b5f6ba15
@metamask-previews/approval-controller@9.0.1-preview-1b5f6ba15
@metamask-previews/assets-controller@7.0.0-preview-1b5f6ba15
@metamask-previews/assets-controllers@106.0.0-preview-1b5f6ba15
@metamask-previews/authenticated-user-storage@1.0.0-preview-1b5f6ba15
@metamask-previews/base-controller@9.1.0-preview-1b5f6ba15
@metamask-previews/base-data-service@0.1.1-preview-1b5f6ba15
@metamask-previews/bridge-controller@72.0.1-preview-1b5f6ba15
@metamask-previews/bridge-status-controller@71.1.1-preview-1b5f6ba15
@metamask-previews/build-utils@3.0.4-preview-1b5f6ba15
@metamask-previews/chain-agnostic-permission@1.6.0-preview-1b5f6ba15
@metamask-previews/chomp-api-service@3.0.0-preview-1b5f6ba15
@metamask-previews/claims-controller@0.5.0-preview-1b5f6ba15
@metamask-previews/client-controller@1.0.1-preview-1b5f6ba15
@metamask-previews/compliance-controller@2.0.0-preview-1b5f6ba15
@metamask-previews/composable-controller@12.0.1-preview-1b5f6ba15
@metamask-previews/config-registry-controller@0.3.0-preview-1b5f6ba15
@metamask-previews/connectivity-controller@0.2.0-preview-1b5f6ba15
@metamask-previews/controller-utils@11.20.0-preview-1b5f6ba15
@metamask-previews/core-backend@6.2.1-preview-1b5f6ba15
@metamask-previews/delegation-controller@3.0.0-preview-1b5f6ba15
@metamask-previews/earn-controller@12.1.0-preview-1b5f6ba15
@metamask-previews/eip-5792-middleware@3.0.3-preview-1b5f6ba15
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-1b5f6ba15
@metamask-previews/eip1193-permission-middleware@2.0.0-preview-1b5f6ba15
@metamask-previews/ens-controller@19.1.1-preview-1b5f6ba15
@metamask-previews/eth-block-tracker@15.0.1-preview-1b5f6ba15
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-1b5f6ba15
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-1b5f6ba15
@metamask-previews/foundryup@1.0.1-preview-1b5f6ba15
@metamask-previews/gas-fee-controller@26.2.0-preview-1b5f6ba15
@metamask-previews/gator-permissions-controller@4.1.0-preview-1b5f6ba15
@metamask-previews/geolocation-controller@0.1.2-preview-1b5f6ba15
@metamask-previews/json-rpc-engine@10.5.0-preview-1b5f6ba15
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-1b5f6ba15
@metamask-previews/keyring-controller@25.5.0-preview-1b5f6ba15
@metamask-previews/logging-controller@8.0.1-preview-1b5f6ba15
@metamask-previews/message-manager@14.1.1-preview-1b5f6ba15
@metamask-previews/messenger@1.2.0-preview-1b5f6ba15
@metamask-previews/messenger-cli@0.2.0-preview-1b5f6ba15
@metamask-previews/money-account-balance-service@1.0.0-preview-1b5f6ba15
@metamask-previews/money-account-controller@0.3.0-preview-1b5f6ba15
@metamask-previews/money-account-upgrade-controller@1.3.1-preview-1b5f6ba15
@metamask-previews/multichain-account-service@9.0.0-preview-1b5f6ba15
@metamask-previews/multichain-api-middleware@3.1.0-preview-1b5f6ba15
@metamask-previews/multichain-network-controller@3.1.0-preview-1b5f6ba15
@metamask-previews/multichain-transactions-controller@7.1.0-preview-1b5f6ba15
@metamask-previews/name-controller@9.1.1-preview-1b5f6ba15
@metamask-previews/network-controller@30.1.0-preview-1b5f6ba15
@metamask-previews/network-enablement-controller@5.1.0-preview-1b5f6ba15
@metamask-previews/notification-services-controller@23.1.0-preview-1b5f6ba15
@metamask-previews/passkey-controller@2.0.1-preview-1b5f6ba15
@metamask-previews/permission-controller@13.1.0-preview-1b5f6ba15
@metamask-previews/permission-log-controller@5.1.0-preview-1b5f6ba15
@metamask-previews/perps-controller@6.0.0-preview-1b5f6ba15
@metamask-previews/phishing-controller@17.1.1-preview-1b5f6ba15
@metamask-previews/polling-controller@16.0.4-preview-1b5f6ba15
@metamask-previews/preferences-controller@23.1.0-preview-1b5f6ba15
@metamask-previews/profile-metrics-controller@3.1.3-preview-1b5f6ba15
@metamask-previews/profile-sync-controller@28.0.2-preview-1b5f6ba15
@metamask-previews/ramps-controller@13.3.0-preview-1b5f6ba15
@metamask-previews/rate-limit-controller@7.0.1-preview-1b5f6ba15
@metamask-previews/react-data-query@0.2.0-preview-1b5f6ba15
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-1b5f6ba15
@metamask-previews/sample-controllers@4.0.4-preview-1b5f6ba15
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-1b5f6ba15
@metamask-previews/selected-network-controller@26.1.1-preview-1b5f6ba15
@metamask-previews/shield-controller@5.1.1-preview-1b5f6ba15
@metamask-previews/signature-controller@39.2.0-preview-1b5f6ba15
@metamask-previews/snap-account-service@0.0.0-preview-1b5f6ba15
@metamask-previews/social-controllers@2.2.0-preview-1b5f6ba15
@metamask-previews/storage-service@1.0.1-preview-1b5f6ba15
@metamask-previews/subscription-controller@6.1.2-preview-1b5f6ba15
@metamask-previews/transaction-controller@65.2.0-preview-1b5f6ba15
@metamask-previews/transaction-pay-controller@22.1.0-preview-1b5f6ba15
@metamask-previews/user-operation-controller@41.2.0-preview-1b5f6ba15

hmalik88
hmalik88 previously approved these changes May 11, 2026
Base automatically changed from cc/feat/snap-account-service-legacy-snap-keyring to main May 11, 2026 21:31
@ccharly ccharly dismissed hmalik88’s stale review May 11, 2026 21:31

The base branch was changed.

@ccharly ccharly enabled auto-merge May 11, 2026 21:43
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 92068a5. Configure here.

export type SnapAccountServiceHandleKeyringSnapMessageAction = {
type: `SnapAccountService:handleKeyringSnapMessage`;
handler: SnapAccountService['handleKeyringSnapMessage'];
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New action type not exported from package index

Medium Severity

SnapAccountServiceHandleKeyringSnapMessageAction is defined and added to the SnapAccountServiceActions union (which is exported), but the individual type itself is not re-exported from index.ts. The existing SnapAccountServiceEnsureReadyAction and SnapAccountServiceGetSnapsAction types are both exported individually, so this is inconsistent and prevents consumers from importing the new action type by name.

Fix in Cursor Fix in Web

Triggered by project rule: Guidance for Bugbot

Reviewed by Cursor Bugbot for commit 92068a5. Configure here.

@ccharly ccharly added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 82cd6a2 May 11, 2026
366 checks passed
@ccharly ccharly deleted the cc/feat/snap-account-service-snap-keyring-messages branch May 11, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants